package com.mashibing.juc.c_004;

/**
 * @author: Yuanzt
 * @Date: 2021/3/24
 */
public class T {

    private static int count = 10;

    public synchronized static void m(){//等同于在方法的代码执行时要synchronized(T.class)
        count--;
        System.out.println(Thread.currentThread().getName()+" count = "+count);
    }

    public static void mm(){
        synchronized (T.class){
            count --;
        }
    }
}
